<div id="sanpham_right">
           	    <div id="title_right">
            		<p id="title_right_left"></p>
            		<div id="title_right_center">
            		  <p class="chu_title">CHI TIẾT HÓA ĐƠN</p>
            		</div>
           			<p id="title_right_right"></p>
             	</div>
                <div id="noidung_right">
<?php if($data) {?>
		<table width = "700" cellpadding = "2" cellspacing = "2" border = "0" align = "center" bgcolor = "#D4D0C8">
			<tr> 
				<td width = "80" valign = "top"> <div align = "center"> <b>Mặt Hàng</b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <b> Người Lập  </b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <b> Ngày Lập </b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <b> Số Lượng  </b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <b> Đơn Giá</b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <b> Thành Tiền </b> </div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <img src="public/images/b_edit.png"/> Sửa</div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <img src="public/images/b_drop.png"/> Xóa </div> </td>
			</tr>
		<?php foreach ($data['list'] as $key => $value){ ?>
			<tr> 
				<td width = "80" valign = "top"> <div align = "center">
					<?php 
						if(is_array($data['listmh'])){
							foreach ($data['listmh'] as $item){
								if($item['MaMH'] == $value['MaMH']){
									echo $item['TenMH'];
								}
							}
						}
					?>
				</div> </td>
				<td width = "80" valign = "top"> <div align = "center">
				<?php 
					if(is_array($data['listhd'])){
						foreach ($data['listhd'] as $item){
							if($item['MaHD'] == $value['MaHD']){
								echo $item['NguoiLap'];
							}
						}
					}
				?>
				</div> </td>
				<td width = "80" valign = "top"> <div align = "center">
				
					<?php 
					if(is_array($data['listhd'])){
						foreach ($data['listhd'] as $item){
							if($item['MaHD'] == $value['MaHD']){
								echo $item['NgayLap'];
							}
						}
					}
				?>
				</div></td>
					<td width = "80" valign = "top"> <div align = "center">
						<?php echo $value['SoLuongBan'];?>
					</div></td>
					<td width = "80" valign = "top"> <div align = "center">
						<?php echo $value['DonGiaBan'];?>
					</div></td>
					<td width = "80" valign = "top"> <div align = "center">
							<?php 
								echo $value['ThanhTienBan'];
							?>
					</div></td>
				<td width = "80" valign = "top"> <div align = "center"> <a href = "admin.php?mod=edit_cthoadon&id=<?php echo $value['MaCT'];?>"> Sửa </a></div> </td>
				<td width = "80" valign = "top"> <div align = "center"> <a href = "admin.php?mod=del_cthoadon&id=<?php echo $value['MaCT'];?>"> Xóa</a> </div> </td>
			</tr>
		<?php } ?>
		</table>
	<?php } ?>
	</div>
	</div>